/*
 * @(#)MaintMtmWorkflowStepPriorityRuleForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;
import com.dcivision.workflow.bean.MtmWorkflowStepPriorityRule;

/**
  MaintMtmWorkflowStepPriorityRuleForm.java

  This class is the for web form purpose.

  @author      Tony Chen
  @company     DCIVision Limited
  @creation date   23/11/2004
  @version     $Revision: 1.1 $
*/

public class MaintMtmWorkflowStepPriorityRuleForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.1 $";

  private String workflowStepID = null;
  private String escalateTrigger = null;
  private String escalateAtField = null;
  private String escalateAtAmt = null;
  private String escalateLevel = null;
  private String escalateAckMethod = null;
  private String escalateAckMethodByEmail = null;
  private String escalateAckMethodBySystem = null;
  private String currentStepID = null;
  private String workflowStepName = null;

  public MaintMtmWorkflowStepPriorityRuleForm() {
    super();
  }

  public String getWorkflowStepID() { 
    return(this.workflowStepID);
  }

  public void setWorkflowStepID(String workflowStepID) { 
    this.workflowStepID = workflowStepID;
  }

  public String getEscalateTrigger() { 
    return(this.escalateTrigger);
  }

  public void setEscalateTrigger(String escalateTrigger) { 
    this.escalateTrigger = escalateTrigger;
  }

  public String getEscalateAtField() { 
    return(this.escalateAtField);
  }

  public void setEscalateAtField(String escalateAtField) { 
    this.escalateAtField = escalateAtField;
  }

  public String getEscalateAtAmt() { 
    return(this.escalateAtAmt);
  }

  public void setEscalateAtAmt(String escalateAtAmt) { 
    this.escalateAtAmt = escalateAtAmt;
  }

  public String getEscalateLevel() { 
    return(this.escalateLevel);
  }

  public void setEscalateLevel(String escalateLevel) { 
    this.escalateLevel = escalateLevel;
  }

  public String getEscalateAckMethod() { 
    return(this.escalateAckMethod);
  }

  public void setEscalateAckMethod(String escalateAckMethod) { 
    this.escalateAckMethod = escalateAckMethod;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setWorkflowStepID(null);
    this.setEscalateTrigger(null);
    this.setEscalateAtField(null);
    this.setEscalateAtAmt(null);
    this.setEscalateLevel(null);
    this.setEscalateAckMethod(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    MtmWorkflowStepPriorityRule tmpMtmWfStepPriorityRule = new MtmWorkflowStepPriorityRule();
    tmpMtmWfStepPriorityRule.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpMtmWfStepPriorityRule.setWorkflowStepID(TextUtility.parseIntegerObj(this.getWorkflowStepID()));
    tmpMtmWfStepPriorityRule.setEscalateTrigger(this.getEscalateTrigger());
    tmpMtmWfStepPriorityRule.setEscalateAtField(TextUtility.parseIntegerObj(this.getEscalateAtField()));
    tmpMtmWfStepPriorityRule.setEscalateAtAmt(TextUtility.parseIntegerObj(this.getEscalateAtAmt()));
    tmpMtmWfStepPriorityRule.setEscalateLevel(TextUtility.parseIntegerObj(this.getEscalateLevel()));
    tmpMtmWfStepPriorityRule.setEscalateAckMethod(this.getEscalateAckMethod());
    tmpMtmWfStepPriorityRule.setRecordStatus(this.getRecordStatus());
    tmpMtmWfStepPriorityRule.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpMtmWfStepPriorityRule.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpMtmWfStepPriorityRule.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpMtmWfStepPriorityRule.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpMtmWfStepPriorityRule.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpMtmWfStepPriorityRule;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    MtmWorkflowStepPriorityRule tmpMtmWfStepPriorityRule = (MtmWorkflowStepPriorityRule)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getID()));
    this.setWorkflowStepID(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getWorkflowStepID()));
    this.setEscalateTrigger(tmpMtmWfStepPriorityRule.getEscalateTrigger());
    this.setEscalateAtField(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getEscalateAtField()));
    this.setEscalateAtAmt(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getEscalateAtAmt()));
    this.setEscalateLevel(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getEscalateLevel()));
    this.setEscalateAckMethod(tmpMtmWfStepPriorityRule.getEscalateAckMethod());
    this.setRecordStatus(tmpMtmWfStepPriorityRule.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpMtmWfStepPriorityRule.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpMtmWfStepPriorityRule.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpMtmWfStepPriorityRule.getUpdateDate()));
  }
  
  public String getEscalateAckMethodByEmail(){
    return this.escalateAckMethodByEmail;  
  }
  
  public void setEscalateAckMethodByEmail( String escalateAckMethodByEmail){
    this.escalateAckMethodByEmail = escalateAckMethodByEmail;  
  }
  
  public String getEscalateAckMethodBySystem(){
    return this.escalateAckMethodBySystem;
  }
  
  public void setEscalateAckMethodBySystem(String escalateAckMethodBySystem){
    this.escalateAckMethodBySystem = escalateAckMethodBySystem;  
  }

  public String getCurrentStepID(){
    return this.currentStepID; 
  }
  
  public void setCurrentStepID(String currentStepID){
    this.currentStepID = currentStepID; 
  }
  
  public String getWorkflowStepName(){
    return this.workflowStepName; 
  }
  
  public void setWorkflowStepName(String workflowStepName) {
    this.workflowStepName = workflowStepName; 
  }
}

